<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSmsErrorsTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sms_errors', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('record_id')->comment('短信通知ID');
            $table->string('error_code')->comment('错误码');
            $table->string('error_message')->comment('错误信息');
            $table->string('data_scope')->nullable()->comment('数据域');
            $table->timestamps();

            $table->comment = '短信通知记录表';
            $table->engine = 'InnoDB';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('sms_errors');
    }

}
